let stack = [
    {
        handle(next){
            console.log('1 begin');
            setTimeout(() => {
                next()
                console.log('1, done');
            }, 5000);
           
        }
    },
    {
        handle(next){
            next();
            console.log('2,done');
        }
    }
]
let index = 0; // 当前正在执行的数组项索引
function co(stack){
    if(index === stack.length) return
  let item = stack[index++]; // 取值完后自增
  item.handle(co.bind(null,stack))
}
co(stack)